<template>
    <div class=" cbox">
            <h4>子路由组件-路径参数</h4>
           <pre>{{ $route.params }}</pre>
           <input type="button" value="打印params 参数" @click="printParams()">
    </div>
</template>
<!-- <script>
    export default {
        methods:{
            printParams(){
                alert(this.$route.params.argA+':'+this.$route.params.argB)
            } 
        }
    }

</script> -->
<script setup>
    import  {useRoute} from 'vue-router'
    const $route = useRoute()
    function printParams(){
        console.log($route);
        
        alert($route.params.argA + ':' + $route.params.argB)
    }

</script>